/*###################################################################*
#
# MPGL Engine - CrossPlatform OpenGL Engine
# Copyright (C) 2014  Mitchell Pell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
####################################################################*/

#ifndef GL_DIRECT_KEYBOARD_INPUT_H
#define GL_DIRECT_KEYBOARD_INPUT_H

#include <boost/shared_ptr.hpp>

#define MPGL_INPUT_BUFFER_SIZE 128
#define MPCON_BLANK_CHAR ' '

namespace mpgl_engine{ namespace application{ namespace input {

	/*!----------------------------------------------------------------
	*	@class		GLDirectKeyboardInput
	*	@brief		
	*
	*	@author		Mitchell Pell
	*	@date		9/28/2013
	*	@version	1.0
	*
	----------------------------------------------------------------*/
	class GLDirectKeyboardInput
	{
		char*			m_inputBuffer;
		unsigned int	m_index;

	public:
		GLDirectKeyboardInput();
		~GLDirectKeyboardInput(){delete [] m_inputBuffer;} 

		char read();
		char peek(){return m_inputBuffer[0];}
		void flush();
		bool push(char chr);

		bool IsInputAvailable(){return m_index > 0; }


	};
	typedef boost::shared_ptr<GLDirectKeyboardInput> spGLDirectKeyboardInput;
}}}

#endif